package com.hx.er.common.system;

import com.hx.er.common.entity.DateIntervalEntity;

public class ErSystem {
	private static long startTime;

	public void load() {
		startTime = System.currentTimeMillis();
	}

	public static long getSysRunningTimeLen() {
		long currentTime = System.currentTimeMillis();
		return currentTime - startTime;
	}

	public static DateIntervalEntity getSysRunningTimeLenDate() {
		long timeBetween = getSysRunningTimeLen() / 1000;
		long date = timeBetween / 3600 / 24;
		long hour = timeBetween % (24 * 3600) / 3600;
		long minute = timeBetween % 3600 / 60;
		long second = timeBetween % 60;
		DateIntervalEntity dateInterval = new DateIntervalEntity(date, hour, minute, second);
		return dateInterval;
	}
}
